package edu.uis.csc478.spring09.threeoxen.persistence.pantry.impl;

import edu.uis.csc478.spring09.threeoxen.persistence.pantry.PantryRepository;
import edu.uis.csc478.spring09.threeoxen.persistence.pantry.Pantry;
import edu.uis.csc478.spring09.threeoxen.persistence.pantry.Recipe;
import edu.uis.csc478.spring09.threeoxen.persistence.pantry.GroceryList;
import edu.uis.csc478.spring09.threeoxen.persistence.BaseRepository;

import java.util.HashMap;

public class PantryRepositoryImpl extends BaseRepository implements PantryRepository {

    private HashMap pantries = new HashMap();


    PantryRepositoryImpl() {
        
    }


    @Override
    public Pantry getPantryByOwnerName(String pantryOwnerName) {
        return (Pantry) this.pantries.get(pantryOwnerName);
    }

    @Override
    public void addPantry(Pantry pantry) {
        this.pantries.put(pantry.getPantryOwnerName(), pantry);
    }

    @Override
    public boolean pantryExists(String pantryOwnerName) {
        return this.pantries.get(pantryOwnerName) != null;
    }

}
